//
//  PlatformTabBarController.swift
//  DSHCMerchant
//
//  Created by 罗德良 on 2018/5/8.
//  Copyright © 2018年 袋鼠好车. All rights reserved.
//

import UIKit

class PlatformTabBarController: YPTabBarController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        initViewControllers()
//        addSpecialItem()
    }
    
    
    
    func initViewControllers() -> Void {
        self.tabBar.itemTitleColor = UIColor.black
        self.tabBar.itemTitleSelectedColor = BaseColor.NavColor
        
        let serviceHomeVC = ServicePlatformViewController()
        serviceHomeVC.yp_tabItemTitle = "平台"
        serviceHomeVC.yp_tabItemImage = UIImage.init(named: "平台_未选中")
        serviceHomeVC.yp_tabItemSelectedImage = UIImage.init(named: "平台_已选择")
        
        let mineVC = ServicePlatfomMineViewController()
        mineVC.yp_tabItemTitle = "我的"
        mineVC.yp_tabItemImage = UIImage.init(named: "我的_未选中")
        mineVC.yp_tabItemSelectedImage = UIImage.init(named: "我的_已选择")
        
        self.viewControllers = [serviceHomeVC,mineVC]
    }
    
    func addSpecialItem() -> Void  {
        let item = YPTabItem.init(type: .custom)
        item.image = UIImage.init(named: "发布")
        item.size = CGSize(width: 80, height: 60)
        self.tabBar.clipsToBounds = false
        self.tabBar.setSpecialItem(item, afterItemWith:0 ,tapHandler: { (ss) in
            let addServiceTaskVC = AddServiceTaskViewController()
            addServiceTaskVC.title = "发布需求";
            self.navigationController?.pushViewController(addServiceTaskVC, animated: true)
            
        })
    }
    
    
}
